package com.xczl.book.entity;

/**
 * 用户实体类
 * 
 * @author Administrator
 *
 */
public class User {

	/**
	 * 主键
	 */
	private Integer userId;

	/**
	 * 用户头像
	 */
	private String userPic;

	/**
	 * 姓名
	 */
	private String name;

	/**
	 * 用户名
	 */
	private String username;

	/**
	 * 性别
	 */
	private Integer sex;

	/**
	 * 男
	 */
	public static final int SEX_MALE = 0;

	/**
	 * 女
	 */
	public static final int SEX_FEMALE = 1;

	/**
	 * 联系电话
	 */
	private String telephone;

	/**
	 * 密码
	 */
	private String password;

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUserPic() {
		return userPic;
	}

	public void setUserPic(String userPic) {
		this.userPic = userPic;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}
	
	public String getSexName(){
		if(sex==0){
			return "男";
		}
		return "女";
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String toString() {
		StringBuffer str = new StringBuffer();
		str.append(name);
		str.append(username);
		str.append(getSexName());
		return str.toString();
	}
}
